﻿@using eBusiness.App_DAL
@{
    ViewBag.Title = "Dash board Admin";
    Layout = "../Shared/_Layout.cshtml";
    var unitOfWork = new UnitOfWork();
}
<h2>
    Dash Board</h2>
<fieldset>
    <legend>Newest products</legend>
    <div>
        @Html.Partial("_LastestProduct", unitOfWork.ProductRepository.Get(p=>p.IsDeleted == false, orderby: p => p.OrderByDescending(o => o.CreatedDate), pageNumber: 1, pageSize: 10, includeProperties: "Categories,Status"))
    </div>
</fieldset>
<div class="spaceDiv"></div>
<fieldset>
    <legend>Newest news</legend>
    <div>
        @Html.Partial("_LastestNews", unitOfWork.NewsRepository.Get(n => n.IsDeleted == false, orderby: p => p.OrderByDescending(o => o.CreatedDate), pageNumber: 1, pageSize: 10))
    </div>
</fieldset>

<div class="spaceDiv"></div>

<div id="leftDashBoardDiv">
    <fieldset>
        <legend>Newest category</legend>
        <div>
            @Html.Partial("_LastestCategories", unitOfWork.CategoryRepository.Get(c => c.IsDeleted == false, orderby: p => p.OrderByDescending(o => o.CreatedDate), pageNumber: 1, pageSize: 10, includeProperties: "Products,Childs,Parent"))
        </div>
    </fieldset>
</div>
<div id="rightDashBoardDiv">
    <fieldset>
        <legend>Newest status</legend>
        <div>
            @Html.Partial("_LastestStatus", unitOfWork.StatusRepository.Get(s => s.IsDeleted == false, orderby: p => p.OrderByDescending(o => o.CreatedDate), pageNumber: 1, pageSize: 10))
        </div>
    </fieldset>
</div>
